package main

import "fmt"

func main() {
	//声明字符串
	const a string = "hello"
	fmt.Println(a)

	//声明数值
	const b = 100
	//fmt.Println(b)

	//声明 第二个 常量 不声明类型 并不赋值 默认 与上一个 常量保持一致
	const (
		c = 1000
		d
	)
	//fmt.Println(c)
	//fmt.Println(d)

	const (
		e = iota //0
		f        //1
		g        //2
	)

	fmt.Printf("e = %d f = %d g = %d\n", e, f, g)

	const (
		A = iota //0
		B        //1
		C        //2
		D        //3
		E = 8    //8
		F = iota //5 因为在第五行所以是 5
		G        //6
	)

	fmt.Printf("A = %d B = %d C = %d D = %d E = %d F = %d G = %d\n", A, B, C, D, E, F, G)
}
